package scc.project.web.interceptor.manage;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import scc.project.entity.Employee;
import scc.project.util.HttpUtil;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 陈圳佳
 */
public class RoleInterceptor extends HandlerInterceptorAdapter {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        String method = request.getMethod();
        if ("GET".contains(method)) return true;
        Employee emp = HttpUtil.getEmp(request.getSession());
        String path = request.getServletPath();
        if (path.indexOf("custom") > 0) {
//            emp.get
        }
        return super.preHandle(request, response, handler);
    }
}
